* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  font-family: "PingFang SC", "Microsoft Yahei", sans-serif;
}
html {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
body {
  width: 100%;
  height: 100%;
  background: #fcee0a;
  position: relative;
}
#loading {
  width: 100%;
  height: 100%;
}
h1 {
  position: absolute;
  left: 10%;
  top: 10%;
  color: #fcee0a;
  font-weight: 900;
  font-size: 90px;
  text-align: center;
}
.container {
  width: 70vw;
  height: 70vh;
  position: absolute;
  background: black;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid black;
  clip-path: polygon(
    0 5%,
    30% 5%,
    35% 0,
    95% 0,
    98% 3%,
    98% 60%,
    100% 65%,
    100% 95%,
    65% 95%,
    60% 100%,
    30% 100%,
    0 70%
  );
}

#video {
  height: 100%;
  width: 100%;
}
#canvas {
  display: none;
  width: 60vw;
  height: 55vh;
}
.myFace {
  width: 300px;
  height: 150px;
  position: absolute;
  top: 50%;
  right: 0%;
  transform: translate(-50%, -50%);
}
.myFace img{
  width: 300px;
  height: 150px;
}
.btn {
  width: 300px;
  height: 80px;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  top: 80%;
  margin: 0 auto;
  cursor: pointer;
}

.btn::before,
.btn::after,
.glitch {
  position: absolute;
  content: "";
  width: 100%;
  height: 100%;
  clip-path: polygon(
    0 0,
    100% 0,
    100% 100%,
    calc(100% - 25px) 100%,
    calc(100% - 25px) calc(100% - 10px),
    calc(100% - 55px) calc(100% - 10px),
    calc(100% - 55px) 100%,
    20px 100%,
    0 calc(100% - 20px)
  );
}
.btn::before {
  background-color: rgb(140, 248, 230);
  left: 2px;
}
.btn::after {
  background-color: hsl(0deg, 100%, 60%);
}
.glitch {
  background: hsl(0deg, 100%, 60%);
  box-shadow: 0 0 0 1px hsl(180, 100%, 50%) inset;
  z-index: 10;
  opacity: 0;
}

.text {
  font-size: 24px;
  font-weight: 800;
  color: white;
  position: relative;
  z-index: 15;
}

.platform {
  position: absolute;
  right: 28px;
  bottom: -4px;
  font-size: 10px;
  letter-spacing: 1px;
  font-weight: 500;
  /* background-color: blue;  */
}
.text::before {
  content: attr(data-text);
  position: absolute;
  display: block;
  top: 0;
  left: 0;
  text-shadow: 1px 1px hsl(180, 100%, 50%), -1px -2px hsl(50deg, 100%, 60%);
  opacity: 0;
}

.btn:hover .glitch,
.btn:hover .text::before {
  animation: glitch-effect 2s infinite;
  opacity: 1;
}

@keyframes glitch-effect {
  0% {
    clip-path: polygon(0 0, 100% 0, 100% 2%, 0 2%);
  }
  5% {
    clip-path: polygon(0 8%, 100% 8%, 100% 16%, 0 16%);
  }
  10% {
    clip-path: polygon(0 80%, 100% 80%, 100% 88%, 0 88%);
    transform: translate3d(-5px, 0, 0);
  }
  15% {
    clip-path: polygon(0 80%, 100% 80%, 100% 88%, 0 88%);
    transform: translate3d(5px, 0, 0);
  }
  16% {
    clip-path: polygon(0 80%, 100% 80%, 100% 88%, 0 88%);
    transform: translate3d(5px, 0, 0);
  }
  17% {
    clip-path: polygon(0 90%, 100% 90%, 100% 100%, 0 100%);
    transform: translate3d(5px, 0, 0);
  }
  18% {
    clip-path: polygon(0 0, 0 0, 0 0, 0 0);
  }
  20% {
    clip-path: polygon(0 30%, 100% 30%, 100% 65%, 0 65%);
  }
  25% {
    clip-path: polygon(0 30%, 100% 30%, 100% 65%, 0 65%);
    transform: translate3d(-5px, 0, 0);
  }
  28% {
    clip-path: polygon(0 30%, 100% 30%, 100% 65%, 0 65%);
    transform: translate3d(-5px, 0, 0);
  }
  29% {
    clip-path: polygon(0 30%, 100% 30%, 100% 65%, 0 65%);
    transform: translate3d(5px, 0, 0);
  }
  30% {
    clip-path: polygon(0 75%, 100% 75%, 100% 100%, 0 100%);
  }

  40% {
    clip-path: polygon(0 45%, 100% 45%, 100% 60%, 0 60%);
  }
  42% {
    clip-path: polygon(0 45%, 100% 45%, 100% 60%, 0 60%);
    transform: translate3d(-5px, 0, 0);
  }
  45% {
    clip-path: polygon(0 45%, 100% 45%, 100% 60%, 0 60%);
    transform: translate3d(5px, 0, 0);
  }
  48% {
    clip-path: polygon(0 45%, 100% 45%, 100% 60%, 0 60%);
    transform: translate3d(-5px, 0, 0);
  }
  50% {
    clip-path: polygon(0 0, 0 0, 0 0, 0 0);
  }
  60% {
    clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%);
  }
  100% {
    clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%);
    transform: translate3d(0, 0, 0);
  }
}
/* ===========扫描特效============ */

.qr-scanner .box {
  width: 60%;
  height: 70%;
  position: absolute;
  left: 50%;
  top: 55%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  border: 0.1rem solid rgba(0, 255, 51, 0.2);
}

.qr-scanner .line {
  height: calc(100% - 2px);
  width: 100%;
  background: linear-gradient(180deg, rgba(0, 255, 51, 0) 43%, #00ff33 211%);
  border-bottom: 3px solid #00ff33;
  transform: translateY(-100%);
  animation: radar-beam 2s infinite;
  animation-timing-function: cubic-bezier(0.53, 0, 0.43, 0.99);
  animation-delay: 1.4s;
}

.qr-scanner .box:after,
.qr-scanner .box:before,
.qr-scanner .angle:after,
.qr-scanner .angle:before {
  content: "";
  display: block;
  position: absolute;
  width: 3vw;
  height: 3vw;

  border: 0.2rem solid transparent;
}

.qr-scanner .box:after,
.qr-scanner .box:before {
  top: 0;
  border-top-color: #00ff33;
}

.qr-scanner .angle:after,
.qr-scanner .angle:before {
  bottom: 0;
  border-bottom-color: #00ff33;
}

.qr-scanner .box:before,
.qr-scanner .angle:before {
  left: 0;
  border-left-color: #00ff33;
}

.qr-scanner .box:after,
.qr-scanner .angle:after {
  right: 0;
  border-right-color: #00ff33;
}

@keyframes radar-beam {
  0% {
    transform: translateY(-100%);
  }

  100% {
    transform: translateY(0);
  }
}
